<div class="posts view content">
	<table class="blog">
		<tr>
			<td>
			<table width="100%" cellpadding="10" cellspacing="0" class="post">
				<tr>
					<td><?php echo $this->Html->link('<h2>'.$post['Post']['name'].'</h2>', array('action' => 'view', $post['Post']['id']),array('escape'=>false)); ?>
						<span class="modified-date"><?php echo $post['Post']['modified']; ?></span>&nbsp;
					</td>
				</tr>
				<tr>
					<td class="content">
					<?php echo $post['Post']['content'];
					?>&nbsp;</td>
				</tr>
				<tr>
					<td>
						<table class="corners" bgcolor="#bbbbbb" cellpadding="4" width="100%" cellspacing="4">
							<tr>
								<td valign="middle" width="12%">
									<?php echo __('Comments:',true)?>
								</td>
								<td valign="middle" align="center" width="3%">
									<?php echo count($post['Comment'])?>
									
								</td>
								<td valign="middle" width="45%">&nbsp;</td>
								<td align="right" valign="middle" width="40%">
									<?php echo $this->Html->link(__('+ add comment',true), array('controller'=>'comments','action' => 'add', $post['Post']['id']),array('class'=>'button corners')); ?>
								</td>								
							</tr>
						</table>
					</td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
</div>


<div class="related view content">
	<h3><?php __('Related Comments');?></h3>
	<?php if (!empty($post['Comment'])):?>
	<table cellpadding = "0" cellspacing = "0" width="100%">
	<?php
		foreach ($post['Comment'] as $comment):
		?>
		<?php if($comment['status']){?>
		<tr>
			<td>
			<table width="100%" cellpadding="10" cellspacing="0" class="post">
				<tr>
					<td class="content">
					<?php echo $comment['content']?>&nbsp;</td>
				</tr>
				<tr>
					<td>
						<table class="corners" bgcolor="#bbbbbb" cellpadding="4" width="100%" cellspacing="4">
							<tr>
								<td valign="middle" width="15%">
									<?php echo __('First Name:',true)?>
								</td>
								<td valign="middle" align="left" width="30%">
									<?php echo $comment['name']?>									
								</td>
								<td valign="middle" width="15%" align="right">
									<?php echo __('Added:',true)?>
								</td>
								<td valign="middle" width="40%" align="left"><?php echo $comment['added']?>&nbsp;</td>
			
							</tr>
						</table>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<?php }?>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

</div>


<?php if($session->check('Auth.User.id')){?>
<?php echo $this->element('toolbar_actions_main',array('plugin'=>'blog','toolbar'=>'posts'))?>
<?php }?>	